<template>
  <van-row gutter="0" type="flex" justify="center">
    <van-col span="4">
      <van-tag
        round
        type="primary"
        :plain="plainAll"
        @click="
          (plainAll = false),
            (plainWeek = true),
            (plainMonth = true),
            (recommendedSort = '1')
        "
        >全部</van-tag
      ></van-col
    >
    <van-col span="4">
      <van-tag
        round
        type="primary"
        :plain="plainWeek"
        @click="
          (plainAll = true),
            (plainWeek = false),
            (plainMonth = true),
            (recommendedSort = '2')
        "
        >本周</van-tag
      ></van-col
    >
    <van-col span="4">
      <van-tag
        round
        type="primary"
        :plain="plainMonth"
        @click="
          (plainAll = true),
            (plainWeek = true),
            (plainMonth = false),
            (recommendedSort = '3')
        "
        >本月</van-tag
      ></van-col
    >
  </van-row>
</template>

<script>
export default {
  data() {
    return {
      plainAll: false, //默认全部
      plainWeek: true, //周
      plainMonth: true, //月
      recommendedSort: "1",
    };
  },
  watch: {
    recommendedSort() {
      this.$emit("sort", this.recommendedSort);
    },
  },
};
</script>

<style></style>
